New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-cdk/aws-sns

Package Overview
Dependencies
Maintainers
5
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/aws-sns

CDK Constructs for AWS SNS

  • 0.33.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
78K
decreased by-12.71%
Maintainers
5
Weekly downloads
 
Created
Source

AWS SNS Construct Library

Add an SNS Topic to your stack:

import sns = require('@aws-cdk/aws-sns');

const topic = new sns.Topic(this, 'Topic', {
    displayName: 'Customer subscription topic'
});

Subscriptions

Various subscriptions can be added to the topic by calling the .subscribeXxx() methods on the topic.

Add an HTTPS Subscription to your topic:

const myTopic = new sns.Topic(this, 'MyTopic');

myTopic.subscribeUrl('MyHttpsSubscription', 'https://foobar.com/');

Subscribe a queue to the topic:

Example of subscribing a queue to a topic

Note that subscriptions of queues in different accounts need to be manually confirmed by reading the initial message from the queue and visiting the link found in it.

CloudWatch Event Rule Target

SNS topics can be used as targets for CloudWatch event rules.

Use the @aws-cdk/aws-events-targets.SnsTopicTarget:

import targets = require('@aws-cdk/aws-events-targets');

codeCommitRepository.onCommit(new targets.SnsTopicTarget(myTopic));

This will result in adding a target to the event rule and will also modify the topic resource policy to allow CloudWatch events to publish to the topic.

Keywords

FAQs

Package last updated on 30 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc